<template>
  <div class="common-layout">
    <el-container>
      <el-header>11</el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            router
            active-text-color="#ffd04b"
            background-color="#545c64"
            class="el-menu-vertical-demo"
            text-color="#fff"
          >
            <el-menu-item
              v-for="(item, index) in $store.state.user.routers"
              :key="index"
              :index="item.path"
            >
              <div v-for="(ele, i) in item.children" :key="i" v-show="i == 0">
                {{ ele.meta.title }}
              </div>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
          <!-- <pre>{{$store.state.user.routers}}</pre> -->
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import { useStore } from "vuex";
const store = useStore();
</script>

<style lang="scss">
.el-header,
.el-footer {
  background-color: #c6e2ff;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d9ecff;
  color: #333;
  text-align: center;
  height: 100vh;
}

.el-main {
  background-color: #ecf5ff;
  color: #333;
  text-align: center;
  line-height: 160px;
}
</style>
